<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2018/10/12
  Time: 11:56
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>account</title>
    <link type="text/css" rel="stylesheet" media="all" href="<%=request.getContextPath()%>/styles/global.css"/>
    <link type="text/css" rel="stylesheet" media="all" href="<%=request.getContextPath()%>/styles/global_color.css"/>
    <script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
    <%--<script language="javascript" type="text/javascript">--%>
    <%--//保存成功的提示信息--%>
    <%--function showResult() {--%>
    <%--showResultDiv(true);--%>
    <%--window.setTimeout("showResultDiv(false);", 3000);--%>
    <%--}--%>

    <%--function showResultDiv(flag) {--%>
    <%--var divResult = document.getElementById("save_result_info");--%>
    <%--if (flag)--%>
    <%--divResult.style.display = "block";--%>
    <%--else--%>
    <%--divResult.style.display = "none";--%>
    <%--//显示选填的信息项--%>
    <%--}--%>
    <%--</script>--%>
</head>
<body>
<!--Logo区域开始-->
<div id="header">
    <img src="../images/logo.png" alt="logo" class="left"/>
    <a href="<%=request.getContextPath()%>/admins/exit">[退出]</a>
</div>
<!--Logo区域结束-->
<!--导航区域开始-->
<div id="navi">
    <c:import url="../navigation.jsp"/>
    <script>
        var li = document.getElementById("menu").children;
        var title = document.getElementsByTagName('title')[0].textContent;
        for (let i = 0; i < li.length; i++) {
            if (li[i].children[0].className.startsWith(title)){
                li[i].children[0].className = title + '_on';
            }
        }
    </script>
</div>
<script>
    function isValid(form) {
        if (form.rePassword.value !== form.loginPasswd.value) {
            alert("两次输入的密码不同！");
            return false;
        }
        else return true;
    }

    function showOptionalInfo() {
        var div = document.getElementById("optionalInfo");
        var img = document.getElementById("img");
        if (div.style.display === "block") {
            div.style.display = "none";
            img.src = "../images/show.png";
        } else {
            div.style.display = "block";
            img.src = "../images/hide.png";
        }
    }

    $(document).ready(function () {
        $("#idcardNo").blur(function () {
            var a = document.getElementById("idcardNo").value.substring(6, 14);
            $("#birthdate").val(a);
            console.log(a);
        });
    });
</script>
<style>
    div.validate_msg_long, div.validate_msg_medium
    {
        /*height: 28px;*/
        line-height: 28px;
        float: right;
        overflow: hidden;
        text-align: left;
        padding-left:5px;
        color: red;
    }
</style>
<!--导航区域结束-->
<!--主要区域开始-->
<div id="main">
    <!--保存成功或者失败的提示消息-->
    <div id="save_result_info" class="save_fail"></div>
    <form action="<%=request.getContextPath()%>/account.add" method="post" class="main_form"
          onSubmit="return isValid(this);">
        <!--必填项-->
        <div class="text_info clearfix"><span>姓名：</span></div>
        <div class="input_info">
            <input type="text" name="realName"/>
            <div class="validate_msg_long ">${result.getFieldError("realName").defaultMessage}</div>
            <span class="required">*</span>
        </div>
        <div class="text_info clearfix"><span>身份证：</span></div>
        <div class="input_info">
            <input type="text" name="idcardNo" id="idcardNo"/>
            <div class="validate_msg_long">${result.getFieldError("idCardNo").defaultMessage}
                ${repeat}</div>
            <span class="required">*</span>
        </div>
        <div class="text_info clearfix"><span>登录账号：</span></div>
        <div class="input_info">
            <input type="text" name="loginName"/>
            <div class="validate_msg_long">${result.getFieldError("loginName").defaultMessage}</div>
            <span class="required">*</span>
        </div>
        <div class="text_info clearfix"><span>密码：</span></div>
        <div class="input_info">
            <input type="password" name="loginPasswd"/>
            <div class="validate_msg_long">${result.getFieldError("loginPasswd").defaultMessage}</div>
            <span class="required">*</span>
        </div>
        <div class="text_info clearfix"><span>重复密码：</span></div>
        <div class="input_info">
            <input type="password" id="rePassword" name="rePassword"/>
            <span class="required">*</span>
        </div>
        <div class="text_info clearfix"><span>电话：</span></div>
        <div class="input_info">
            <input type="text" class="width200" name="telephone"/>
            <div class="validate_msg_medium">${result.getFieldError("telephone").defaultMessage}</div>
            <span class="required">*</span>
        </div>
        <!--可选项-->
        <div class="text_info clearfix"><span>可选项：</span></div>
        <div class="input_info" onclick="showOptionalInfo(this);" id="imgObj">
            <img src="../images/show.png" alt="展开" id="img"/>
        </div>
        <div id="optionalInfo" style="display: none;">
            <div class="text_info clearfix"><span>推荐人业务账号：</span></div>
            <div class="input_info">
                <input type="text" name="recommenderId"/>
            </div>
            <div class="text_info clearfix"><span>生日：</span></div>
            <div class="input_info">
                <input type="text" name="birthdate" id="birthdate" class="readonly" readonly value=""/>
            </div>
            <div class="text_info clearfix"><span>Email：</span></div>
            <div class="input_info">
                <input type="text" class="width350" name="email"/>
                <div class="validate_msg_tiny">${result.getFieldError("email").defaultMessage}</div>
            </div>
            <div class="text_info clearfix"><span>职业：</span></div>
            <div class="input_info">
                <input name="occupation"/>
            </div>
            <div class="text_info clearfix"><span>性别：</span></div>
            <div class="input_info fee_type">
                <input type="radio" name="gender" id="female" value="女"/>
                <label for="female">女</label>
                <input type="radio" name="gender" id="male" value="男"/>
                <label for="male">男</label>
            </div>
            <div class="text_info clearfix"><span>通信地址：</span></div>
            <div class="input_info">
                <div class="validate_msg_tiny" style="color: black">${result.getFieldError("mailaddress").defaultMessage}</div>
                <input type="text" class="width350" name="mailaddress"/>
            </div>
            <div class="text_info clearfix"><span>邮编：</span></div>
            <div class="input_info">
                <div class="validate_msg_long" style="color: black">${result.getFieldError("zipcode").defaultMessage}</div>
                <input type="text" name="zipcode"/>
            </div>
            <div class="text_info clearfix"><span>QQ：</span></div>
            <div class="input_info">
                <div class="validate_msg_long" style="color: black">${result.getFieldError("qq").defaultMessage}</div>
                <input type="text" name="qq"/>
            </div>
        </div>
        <!--操作按钮-->
        <div class="button_info clearfix">
            <input type="submit" value="保存" class="btn_save"/>
            <input type="reset" value="重置" class="btn_save"/>
            <input type="button" value="取消" class="btn_save" onclick="location.href='/account.page?page=0';"/>
        </div>
    </form>
</div>
<!--主要区域结束-->
<div id="footer">
    <span>[源自北美的技术，最优秀的师资，最真实的企业环境，最适用的实战项目]</span>
    <br/>
    <span>版权所有(C)云科技有限公司 </span>
</div>
</body>
</html>
